package com.sxdz.controller.service.sys

import com.sxdz.controller.mapper.TSysConfigMapper
import com.sxdz.controller.service.BaseService
import com.sxdz.models.TSysConfig
import groovy.transform.CompileStatic
import groovy.transform.TypeChecked
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

/**
 * Created by lzw on 2016/8/1.
 */
@Service
@CompileStatic
@TypeChecked
public class SysConfigService extends BaseService implements ISysConfigService{

    private TSysConfigMapper sysConfigMapper;

    @Autowired
    public void setSysConfigMapper(TSysConfigMapper sysConfigMapper){
        this.sysConfigMapper = sysConfigMapper;
        super.baseMapper = sysConfigMapper;
    }

    @Override
    @Transactional
    Long addBasic(def Object obj) throws Exception {
        TSysConfig sysConfig = obj as TSysConfig
        return sysConfigMapper.insert(sysConfig)
    }

    @Override
    @Transactional
    void modifyBasic(def Object obj) throws Exception {
        TSysConfig sysConfig = obj as TSysConfig
        sysConfigMapper.updateByPrimaryKey(sysConfig);
    }

    @Override
    @Transactional
    void delBasic(def Object obj) throws Exception {
        TSysConfig sysConfig = obj as TSysConfig
        sysConfigMapper.deleteByPrimaryKey(sysConfig)
    }
}
